From: Colin Walters Date: Fri, 5 Dec 2008 21:50:09 +0000 (+0000) Subject: Use idle handler for overlay key binding X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~11520 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=bd53366247f05924f4369cb34738a3363efb2bcf;p=gnome-shell.git Use idle handler for overlay key binding Running into odd problems with the overlay/windows key breaking, hopefully this will work around those. svn path=/trunk/; revision=121 --- diff --git a/js/ui/main.js b/js/ui/main.js index aef8057fb..62fa65c41 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -3,6 +3,7 @@ const Clutter = imports.gi.Clutter; const Shell = imports.gi.Shell; const Signals = imports.signals; +const Mainloop = imports.mainloop; const Tweener = imports.tweener.tweener; const Panel = imports.ui.panel; @@ -123,11 +124,16 @@ function start() { let display = global.screen.get_display(); display.connect('overlay-key', function(display) { - if (overlay.visible) { - hide_overlay(); - } else { - show_overlay(); - } + // Queue an idle for this, because we're getting called + // out of a metacity event handler, and doing a lot of + // work from inside there is...iffy. + Mainloop.idle_add(function () { + if (overlay.visible) { + hide_overlay(); + } else { + show_overlay(); + } + }); }); }